Currently, IPv4 addresses are getting exhausted, and the problem of IP address shortage is very serious. At present, the problem of IP address shortage is temporarily alleviated by deploying a Carrier Grade NAT (CGN) device in an operator network. A function of Network Address Translation (NAT) is to: when a PC in an internal private network needs to get connected to an external public network, translate an internal address used by the PC in the internal private network into a valid address in the external public network, to ensure normal use of the PC in the external public network. Because multiple PCs in the internal private network can share one valid address in the external public network, the problem of IP address shortage is alleviated to some extent.
Because the CGN plays a crucial role, during actual use, dual-host standby is required, or quick recovery can be implemented after the CGN restarts. However, the CGN stores a large number of dynamic NAT entries; and it is often very difficult to back up these entries in real time, and if the CGN restarts, it is also very difficult to quickly recover these entries. As a result, a connection between a PC user in the internal private network and the external public network has to be re-established.
An IETF (Internet Engineering Task Force) PCP (Port Control Protocol) working group can establish, by using the PCP protocol, the connection between the PC user in the internal private network and the external public network after the CGN restarts or undergoes an active/standby switchover. However, a precondition for implementing the recovery is that a CPE (Customer Premise Equipment) connected to the PC in the internal private network can quickly sense that the CGN device restarts or undergoes an active/standby switchover. That the CGN restarts or undergoes an active/standby switchover is usually referred to as a CGN exception, which, however, is not limited thereto.
Referring to FIG. 1, currently, a specific method of solution 1 includes: when a PCP server (Port Control Protocol server), that is, a CGN, is in an abnormal condition, sending, by using a unicast message, information for indicating Restart announce to each PCP client (Port Control Protocol client), that is, a CPE; and when receiving the information for indicating Restart announce, sending, by the PCP client, NAT mapping information to the PCP server by using the PCP protocol.
However, for the method of solution 1, the PCP server needs to recover, in an abnormal condition, all PCP client information that exists before the abnormal condition of the PCP server occurs. Because a quantity of the information is huge, correspondingly, it needs to take a relatively long time to recover the information. In addition, the PCP server needs to send a message to each PCP client after the PCP server restarts or undergoes an active/standby switchover, which also increases load of the PCP server.
Referring to FIG. 2, a specific method of solution 2 includes: when a PCP server is in an abnormal condition, sending a Restart announce message to each PCP client in a multicast manner.
However, the method of solution 2 is only applicable to a case in which a network between the PCP server and the PCP client is a Layer 2 network, and consequently has a small application scope and is inapplicable to a commonest application scenario at present.